home *** CD-ROM | disk | FTP | other *** search
/ Champak 54 / Vol 54.iso / games / williame.swf / scripts / frame_21 / PlaceObject2_266_11 / CLIPACTIONRECORD onClipEvent(enterFrame).as
Encoding:
Text File  |  2007-09-27  |  1.1 KB  |  54 lines

  1. onClipEvent(enterFrame){
  2.    xheros = _root.ship._x;
  3.    yheros = _root.ship._y;
  4.    xzebre = _root.zebre3._x;
  5.    yzebre = _root.zebre3._y;
  6.    if(xzebre < xheros)
  7.    {
  8.       setProperty("_root.zebre3", _X, xzebre + 1);
  9.    }
  10.    if(xheros < xzebre)
  11.    {
  12.       setProperty("_root.zebre3", _X, xzebre - 1);
  13.    }
  14.    if(yzebre < yheros)
  15.    {
  16.       setProperty("_root.zebre3", _Y, yzebre + 1);
  17.    }
  18.    if(yheros < yzebre)
  19.    {
  20.       setProperty("_root.zebre3", _Y, yzebre - 1);
  21.    }
  22.    if(yheros < yzebre)
  23.    {
  24.       setProperty("_root.zebre3", _rotation, -90);
  25.    }
  26.    if(yzebre < yheros)
  27.    {
  28.       setProperty("_root.zebre3", _rotation, 90);
  29.    }
  30.    if(xzebre < xheros)
  31.    {
  32.       setProperty("_root.zebre3", _rotation, 0);
  33.    }
  34.    if(xheros < xzebre)
  35.    {
  36.       setProperty("_root.zebre3", _rotation, 180);
  37.    }
  38.    if(_root.zebre3.hitTest(_root.ship))
  39.    {
  40.       tellTarget("_root.energie")
  41.       {
  42.          nextFrame();
  43.       }
  44.       tellTarget("_root.zebre3")
  45.       {
  46.          gotoAndStop(5);
  47.       }
  48.    }
  49.    else
  50.    {
  51.       play();
  52.    }
  53. }
  54.